<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>

    <h:body>
        <ui:composition>
            <p:panel>
                <h:form prependId="false">

                    <p:dataTable var="driver" value="#{preCompany.lst}" paginator="true" rows="5" style="margin-top: 3">

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Contact person" />
                            </f:facet>
                            <h:outputText value="#{driver.contact}" />
                        </p:column>


                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Address" />
                            </f:facet>
                            <h:outputText value="#{driver.address}" />
                        </p:column>


                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Experience" />
                            </f:facet>
                            <h:outputText value="#{driver.experience}" />
                        </p:column>

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Gender" />
                            </f:facet>
                            <h:outputText value="#{preCompany.getgenderName(driver.gender)}" />
                        </p:column>    

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="City" />
                            </f:facet>
                            <h:outputText value="#{preCompany.gCityName(driver.accId)}" />
                        </p:column>                                      

                        <p:column style="width:32px">
                            <p:commandButton update="display" oncomplete="driverDialog.show()"
                                             style="background-image :url('./../images/Search.png'); height: 50px;width: 50px">
                                <f:setPropertyActionListener value="#{driver}"
                                                             target="#{preCompany.selectedDriver}" />
                            </p:commandButton>
                        </p:column>



                    </p:dataTable>

                    <p:dialog header="Driver Detail" widgetVar="driverDialog" resizable="false"
                              width="400" showEffect="explode" hideEffect="explode">

                        <h:panelGrid id="display" columns="2" cellpadding="4" border="1" cellspacing="4">

                            <f:facet name="header">
                                <h:outputText value="Driver's Information"/>
                            </f:facet>


                            <h:outputText value="Contact Person" />
                            <h:outputText value="#{preCompany.selectedDriver.contact}" />

                            <h:outputText value="Mobile:" />
                            <h:outputText value="#{preCompany.selectedDriver.mobile}" />

                            <h:outputText value="Telephone:" />
                            <h:outputText value="#{preCompany.selectedDriver.tele}" />

                            <h:outputText value="Address:" />
                            <h:outputText value="#{preCompany.selectedDriver.address}" />

                            <h:outputText value="Description:" />
                            <h:outputText value="#{preCompany.selectedDriver.description}" />

                            <h:outputText value="Email:" />
                            <h:outputText value="#{preCompany.selectedDriver.email}" />

                            <h:outputText value="Experience:" />
                            <h:outputText value="#{preCompany.selectedDriver.experience}" />

                            <h:outputText value="Gender:" />
                            <h:outputText value="#{preCompany.getgenderName(preCompany.selectedDriver.gender)}" />

                            <h:outputText value="City:" />
                            <h:outputText value="#{preCompany.gCityName(preCompany.selectedDriver.accId)}" />
<f:facet name="footer">
    <center>
    <p:commandButton onclick="driverDialog.hide()" value="Close"/>
    </center>
                            </f:facet>
                        </h:panelGrid>
                    </p:dialog>

                </h:form>
            </p:panel> 
        </ui:composition>
    </h:body>
</html>


